package cn.t.keycloak.plugin.login.rest;

import lombok.extern.slf4j.Slf4j;
import org.keycloak.Config;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.services.resource.RealmResourceProvider;
import org.keycloak.services.resource.RealmResourceProviderFactory;

/**
 * 手机验证码相关接口
 * @author 陶敏麒
 * @date 2023/11/20 15:00
 */
@Slf4j
public class SmsRestProviderFactory implements RealmResourceProviderFactory {
    private static final String ID = "sms-rest";
    @Override
    public RealmResourceProvider create(KeycloakSession keycloakSession) {
        return new SmsRestProvider(keycloakSession);
    }

    @Override
    public void init(Config.Scope scope) {
        log.info(">>>>>SmsRestProviderFactory开始初始化");
    }

    @Override
    public void postInit(KeycloakSessionFactory keycloakSessionFactory) {}

    @Override
    public void close() {}

    @Override
    public String getId() {
        return ID;
    }
}
